home *** CD-ROM | disk | FTP | other *** search
- #import <appkit/appkit.h>
- #import "GACUPSListener.h"
- #import <mach/mach.h>
- #import <mach/message.h>
- #import <servers/netname.h>
- extern port_t name_server_port;
- extern id NXResponsibleDelegate();
- @implementation GACUPSListener :Listener
- {}
- static NXRemoteMethod *remoteMethods = NULL;
- #define REMOTEMETHODS 1
- + initialize
- /* */
- {
- if (!remoteMethods) {
- remoteMethods =
- (NXRemoteMethod *) malloc((REMOTEMETHODS+1)*sizeof(NXRemoteMethod));
- remoteMethods[0].key =
- @selector(systemMode:inverterStatus:alarmStatus:ACInputVolts:ACOutputVolts:ACOutputDeciAmperes:ACLoadVA:batteryDeciVolts:deciHertz:minutes:ambientTemp:ROMVersion:time:);
- remoteMethods[0].types = "IIIIIIIIIIIII";
- remoteMethods[REMOTEMETHODS].key = NULL;
- }
- return self;
- }
- -(int)systemMode : (int *) systemMode
- inverterStatus : (int *) inverterStatus
- alarmStatus : (int *) alarmStatus
- ACInputVolts : (int *) ACInputVolts
- ACOutputVolts : (int *) ACOutputVolts
- ACOutputDeciAmperes : (int *) ACOutputDeciAmperes
- ACLoadVA : (int *) ACLoadVA
- batteryDeciVolts : (int *) batteryDeciVolts
- deciHertz : (int *) deciHertz
- minutes : (int *) minutes
- ambientTemp : (int *) ambientTemp
- ROMVersion : (int *) ROMVersion
- time : (int *) time
- /* */
- {
- id _NXd;
- if (_NXd = NXResponsibleDelegate(self,
- @selector(systemMode:inverterStatus:alarmStatus:ACInputVolts:ACOutputVolts:ACOutputDeciAmperes:ACLoadVA:batteryDeciVolts:deciHertz:minutes:ambientTemp:ROMVersion:time:)))
- return [_NXd systemMode : systemMode
- inverterStatus : inverterStatus
- alarmStatus : alarmStatus
- ACInputVolts : ACInputVolts
- ACOutputVolts : ACOutputVolts
- ACOutputDeciAmperes : ACOutputDeciAmperes
- ACLoadVA : ACLoadVA
- batteryDeciVolts : batteryDeciVolts
- deciHertz : deciHertz
- minutes : minutes
- ambientTemp : ambientTemp
- ROMVersion : ROMVersion
- time : time];
- return -1;
- }
-
- - (int) performRemoteMethod : (NXRemoteMethod *) method
- paramList : (NXParamValue *) paramList {
- /* */
- switch (method - remoteMethods) {
- case 0:
- return [self systemMode : ¶mList[0].ival
- inverterStatus : ¶mList[1].ival
- alarmStatus : ¶mList[2].ival
- ACInputVolts : ¶mList[3].ival
- ACOutputVolts : ¶mList[4].ival
- ACOutputDeciAmperes : ¶mList[5].ival
- ACLoadVA : ¶mList[6].ival
- batteryDeciVolts : ¶mList[7].ival
- deciHertz : ¶mList[8].ival
- minutes : ¶mList[9].ival
- ambientTemp : ¶mList[10].ival
- ROMVersion : ¶mList[11].ival
- time : ¶mList[12].ival];
- default:
- return [super performRemoteMethod : method paramList : paramList];
- }
- }
- - (NXRemoteMethod *) remoteMethodFor: (SEL) aSel {
- /* */
- NXRemoteMethod *rm;
- if (rm = NXRemoteMethodFromSel(aSel,remoteMethods))
- return rm;
- return [super remoteMethodFor : aSel];
- }
- @end
-